let express = require('express');
let app = express();

app.use((req,res,next)=>{
    res.setHeader('Access-Control-Allow-Origin', "*");
    res.setHeader('Access-Control-Allow-Headers', "*"); // 允许客户端可以设置请求头  
    next()
});

app.use(express.json());
// app.use(express.urlencoded({extended:false}));

app.post('/login',(req,res)=>{

    let {username,pwd} = req.body;

    res.json({
        username,
        pwd
    })
});


app.listen(80,()=>{
    console.log("启动成功");
})